package com.atguigu.gulimall.cart.feign;


import com.atguigu.common.utils.R;
import com.atguigu.gulimall.cart.feign.fallback.ProductFeignServiceFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author xiaoping
 */
@FeignClient(value = "gulimall-product",fallback = ProductFeignServiceFallBack.class)
public interface ProductFeignService {


    /**
     * 获取sku基本信息
     */
    @RequestMapping("/product/skuinfo/info/{skuId}")
    R getSkuInfo(@PathVariable("skuId") Long skuId);

    /**
     * 获取sku组合信息
     * @param skuId
     * @return
     */
    @GetMapping("/product/skusaleattrvalue/stringList/{skuId}")
    List<String> getSkuSaleAttrValues(@PathVariable("skuId") Long skuId);

    /**
     * 获取商品价格
     * @param skuId
     * @return
     */
    @GetMapping("/product/skuinfo/{skuId}/price")
    R getPrice(@PathVariable("skuId") Long skuId);

}
